﻿Public Class cPanel
#Region "Account Creation"
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If My.Computer.FileSystem.DirectoryExists("%appdata%\AliveOS\Open") = True Then
        Else
        End If

        If TextBox1.Text = "" Then
            MsgBox(MsgBoxStyle.OkOnly, "Your username requires more than one character")
        Else
        End If

        If TextBox2.Text = "" Then
            MsgBox(MsgBoxStyle.OkOnly, "Please insert a password.")
        Else
            MkDir("%appdata%\AliveOS\Open" + TextBox1.Text)
            Dim username As New System.IO.StreamWriter("%appdata%\AliveOS\Open" + TextBox1.Text + "\" + "username.txt")
            username.Write(TextBox1.Text)
            username.Close()
            Dim password As New System.IO.StreamWriter("%appdata%\AliveOS\Open" + TextBox1.Text + "\" + "password.txt")
            password.Write(TextBox2.Text)
            password.Close()
            MsgBox(MsgBoxStyle.OkOnly, "Account Creation Sucessful")
        End If
    End Sub
#End Region
#Region "Account Removal"
    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        If My.Computer.FileSystem.DirectoryExists("%appdata%\AliveOS\Open\") = True Then
        Else
        End If

        If TextBox1.Text = "" Then
            MsgBox(MsgBoxStyle.OkOnly, "Your username contains more than one character")
        Else
        End If

        If TextBox2.Text = "" Then
            MsgBox(MsgBoxStyle.OkOnly, "Please insert a password.")
        Else
            MkDir("%appdata%\AliveOS\Open" + TextBox1.Text)
            Dim username As New System.IO.StreamWriter("%appdata%\AliveOS\Open\" + TextBox1.Text + "\" + "username.txt")
            username.Write("")
            username.Close()
            Dim password As New System.IO.StreamWriter("%appdata%\AliveOS\Open\" + TextBox1.Text + "\" + "password.txt")
            password.Write("")
            password.Close()
            MsgBox(MsgBoxStyle.OkOnly, "Account Removal Sucessful")
        End If
    End Sub
#End Region
#Region "Taskbar Schemes"
    Private Sub PictureBox6_Click(sender As Object, e As EventArgs) Handles PictureBox6.Click
        Label9.Text = "Selected Scheme: Blue"
        Button3.Enabled = True
    End Sub

    Private Sub PictureBox4_Click(sender As Object, e As EventArgs) Handles PictureBox4.Click
        Label9.Text = "Selected Scheme: Brown"
        Button3.Enabled = True
    End Sub

    Private Sub PictureBox3_Click(sender As Object, e As EventArgs) Handles PictureBox3.Click
        Label9.Text = "Selected Scheme: Default"
        Button3.Enabled = True
    End Sub

    Private Sub PictureBox5_Click(sender As Object, e As EventArgs) Handles PictureBox5.Click
        Label9.Text = "Selected scheme: Red"
        Button3.Enabled = True
    End Sub

    Private Sub PictureBox7_Click(sender As Object, e As EventArgs) Handles PictureBox7.Click
        Label9.Text = "Selected Scheme: Purple"
        Button3.Enabled = True
    End Sub

    Private Sub PictureBox2_Click(sender As Object, e As EventArgs) Handles PictureBox2.Click
        Label9.Text = "Selected Scheme: Yellow"
        Button3.Enabled = True
    End Sub

    Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
        If Label9.Text = "Selected Scheme: Blue" Then
            Desktop.Panel1.BackgroundImage = System.Drawing.Image.FromFile("BlueTint.jpg")
        End If
        If Label9.Text = "Selected Scheme = Brown" Then
            Desktop.Panel1.BackgroundImage = System.Drawing.Image.FromFile("BrownTint.jpg")
        End If
        If Label9.Text = "Selected Scheme: Default" Then
            Desktop.Panel1.BackgroundImage = System.Drawing.Image.FromFile("DefaultTint.jpg")
        End If
        If Label9.Text = "Selected Scheme: Red" Then
            Desktop.Panel1.BackgroundImage = System.Drawing.Image.FromFile("RedTint.jpg")
        End If
        If Label9.Text = "Selected Scheme: Purple" Then
            Desktop.Panel1.BackgroundImage = System.Drawing.Image.FromFile("PurpleTint.jpg")
        End If
        If Label9.Text = "Selected Scheme: Yellow" Then
            Desktop.Panel1.BackgroundImage = System.Drawing.Image.FromFile("YellowTint.jpg")
        End If
    End Sub
#End Region
End Class